package cn.controller.marketing;

import cn.service.marketingService.MarketingServiceImpl.FlashSaleProductServiceImpl;
import entity.marketingEntity.FlashAddCondition;
import entity.marketingEntity.FlashProductCondition;
import entity.marketingEntity.FlashSaleProduct;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/31 23:54
 */
@RestController
@CrossOrigin
@RequestMapping("/marketing")
public class FlashSaleProductController {
    @Autowired
    FlashSaleProductServiceImpl service;
    @RequestMapping("/getFlashSaleProductDetails")
    public Result getFlashSaleProductDetails(@RequestBody FlashProductCondition flashProductCondition){
        return service.getFlashSaleProductDetails(flashProductCondition);
    }
    @RequestMapping("/addflashproduct")
    public Result addflashproduct(@RequestBody FlashAddCondition condition){
        return service.addflashproduct(condition);
    }
    @RequestMapping("/deleteflashproduct")
    public Result deleteflashproduct(Integer id){
        return service.deleteflashproduct(id);
    }
    @RequestMapping("/modifyflashproduct")
    public Result modifyflashproduct(@RequestBody FlashSaleProduct flashSaleProduct){
        return service.modifyflashproduct(flashSaleProduct);
    }
}
